package com.nbsaas.boot.store.rest.resource;

import com.nbsaas.boot.store.api.apis.StorePayApi;
import com.nbsaas.boot.store.data.entity.StorePay;
import com.nbsaas.boot.store.api.domain.request.StorePayRequest;
import com.nbsaas.boot.store.api.domain.response.StorePayResponse;
import com.nbsaas.boot.store.api.domain.simple.StorePaySimple;
import com.nbsaas.boot.store.rest.convert.StorePaySimpleConvert;
import com.nbsaas.boot.store.rest.convert.StorePayEntityConvert;
import com.nbsaas.boot.store.rest.convert.StorePayResponseConvert;
import com.nbsaas.boot.store.data.repository.StorePayRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class StorePayResource extends BaseResource<StorePay,StorePayResponse, StorePaySimple, StorePayRequest>  implements StorePayApi {

    @Resource
    private StorePayRepository storePayRepository;

    @Override
    public JpaRepositoryImplementation<StorePay, Serializable> getJpaRepository() {
        return storePayRepository;
    }

    @Override
    public Function<StorePay, StorePaySimple> getConvertSimple() {
        return new StorePaySimpleConvert();
    }

    @Override
    public Function<StorePayRequest, StorePay> getConvertForm() {
        return new StorePayEntityConvert();
    }

    @Override
    public Function<StorePay, StorePayResponse> getConvertResponse() {
        return new StorePayResponseConvert();
    }




}


